export default {
  namespaced:true,
  state:()=>({
    name:"珠峰"
  }),
  mutations:{
    changeName(state,option){
      // 只能获取当前state  没有办法获取根的state
      console.log(option)
      state.name = option.option
    }
  },
  actions:{
    changeName(store,option){
      console.log(store)// 这里的store中多了两个属性 rootState  rootGetters
      setTimeout(() => {
        store.commit('changeName',{option,age:store.rootState.age})
      }, 500);
    }
  }
}